-
Notifications
You must be signed in to change notification settings - Fork 927
Fix ssz formatting for /light_client/updates beacon API endpoint
#7806
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
4c84840 to
8de9157
Compare
|
Some required checks have failed. Could you please take a look @eserilev? 🙏 |
| fn ssz_append(&self, buf: &mut Vec<u8>) { | ||
| buf.extend_from_slice(&self.response_chunk_len.to_le_bytes()); | ||
| buf.extend_from_slice(&self.response_chunk.context); | ||
| match &self.response_chunk.payload { | ||
| LightClientUpdate::Altair(lc) => lc.ssz_append(buf), | ||
| LightClientUpdate::Capella(lc) => lc.ssz_append(buf), | ||
| LightClientUpdate::Deneb(lc) => lc.ssz_append(buf), | ||
| LightClientUpdate::Electra(lc) => lc.ssz_append(buf), | ||
| LightClientUpdate::Fulu(lc) => lc.ssz_append(buf), | ||
| }; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks a bit sus to me, how does this differ from what derive generates?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you're right, the match is exactly what derive generates. I cleaned things up a bit 67b45a9
|
Some required checks have failed. Could you please take a look @eserilev? 🙏 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Issue Addressed
#7759
Proposed Changes
We were incorrectly encoding the full response from
/light_client/updatesinstead of only encoding the light client updateAdditional Notes
This repo has a script that verifies light client data. I've used the repo to verify lc updates generated from both lodestar and lighthouse
https://github.com/eserilev/verify_light_client_update/tree/main